<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/doc/src/emb-charinput.qdoc -->
<head>
  <title>Qt 4.3: Qtopia Core Character Input</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Qtopia Core Character Input<br /><small></small></h1>
<p>When running a <a href="qtopiacore.html">Qtopia Core</a> application, it either runs as a server or connects to an existing server. The keyboard driver is loaded by the server application when it starts running, using Qt's <a href="plugins-howto.html">plugin system</a>.</p>
<p>Internally in the client/server protocol, all system generated events, including key events, are passed to the server application which then propagates the event to the appropiate client. Note that key events do not always come from a keyboard device, they can can also be generated by the server process using input widgets.</p>
<p><table align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>Input Widgets</th></tr></thead>
<tr valign="top" class="odd"><td>The server process may call the static <a href="qwsserver.html#sendKeyEvent">QWSServer::sendKeyEvent</a>() function at any time. Typically, this is done by popping up a widget that enables the user specify characters with the pointer device.<p>Note that the key input widget should not take focus since the server would then just send the key events back to the input widget. One way to make sure that the input widget never takes focus is to set the <a href="qt.html#WindowType-enum">Qt::Tool</a> widget flag in the <a href="qwidget.html">QWidget</a> constructor.</p>
<p>The <a href="http://www.trolltech.com/products/qtopia/">Qtopia</a> environment contains various input widgets such as Handwriting Recognition and Virtual Keyboard.</p>
</td></tr>
</table></p>
<ul><li><a href="#available-keyboard-drivers">Available Keyboard Drivers</a></li>
<li><a href="#specifying-a-keyboard-driver">Specifying a Keyboard Driver</a></li>
</ul>
<a name="available-keyboard-drivers"></a>
<h2>Available Keyboard Drivers</h2>
<p><a href="qtopiacore.html">Qtopia Core</a> provides ready-made drivers for the SL5000, Yopy, Vr41XX, console (TTY) and USB protocols. Run the <tt>configure</tt> script to list the available drivers:</p>
<pre> ./configure -help</pre>
<p>Note that the console keyboard driver also handles console switching (<b>Ctrl+Alt+F1</b>, ..&#x2e;, <b>Ctrl+Alt+F10</b>) and termination (<b>Ctrl+Alt+Backspace</b>).</p>
<p>In the default Qt configuration, only the &quot;TTY&quot; driver is enabled. The various drivers can be enabled and disabled using the <tt>configure</tt> script. For example:</p>
<pre> configure -qt-kbd-s15000</pre>
<p>Custom keyboard drivers can be implemented by subclassing the <a href="qwskeyboardhandler.html">QWSKeyboardHandler</a> class and creating a keyboard driver plugin (derived from the <a href="qkbddriverplugin.html">QKbdDriverPlugin</a> class). <a href="qtopiacore.html">Qtopia Core</a>'s implementation of the <a href="qkbddriverfactory.html">QKbdDriverFactory</a> class will automatically detect the plugin, loading the driver into the server application at runtime.</p>
<a name="specifying-a-keyboard-driver"></a>
<h2>Specifying a Keyboard Driver</h2>
<p>To specify which driver to use, set the <a href="qtopiacore-envvars.html#qws-keyboard">QWS_KEYBOARD</a> environment variable. For example (if the current shell is bash, ksh, zsh or sh):</p>
<pre>  export QWS_KEYBOARD=&lt;driver&gt;[:&lt;driver specific options&gt;]</pre>
<p>The <tt>&lt;driver&gt;</tt> argument are <tt>SL5000</tt>, <tt>Yopy</tt>, <tt>VR41xx</tt>, <tt>TTY</tt>, <tt>USB</tt> and <a href="qkbddriverplugin.html#keys">keys</a> identifying custom drivers, and the driver specific options are typically a device, e.g&#x2e;, <tt>/dev/tty0</tt>.</p>
<p>Multiple keyboard drivers can be specified in one go:</p>
<pre>  export QWS_KEYBOARD=&quot;&lt;driver&gt;[:&lt;driver specific options&gt;]
          &lt;driver&gt;[:&lt;driver specific options&gt;]
          &lt;driver&gt;[:&lt;driver specific options&gt;]&quot;</pre>
<p>Input will be read from all specified drivers.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
